<?php
namespace app\api\controller;
use app\common\BaseController;
use app\api\model\Logs as LogsModel;
class Logs extends BaseController{    

    public function __construct(LogsModel $model){
        parent::__construct();
        $this->model = $model;
    }

    public function index(){
        $where=[];
        $params = $this->request->param(); 
        if(!empty($params['sn']) || !empty($params['keyword'])){         
            //查询团号
            if(!empty($params['sn'])){
                $where['sn'] = ['like',"%{$params['sn']}%"];
            }
            //模糊查询           
            if(!empty($params['keyword'])){
                $where['old|new'] = ['like',"%{$params['keyword']}%"];               
            }
            $data = $this->model->with("operator")->where($where)->select();
            return $data;
        }  
        return array();  
    }
}